﻿import com.dmotiko.mirador.*
import com.dmotiko.general.*
import mx.utils.Delegate;

class MiradorLogo
extends BaseClip {
	
	private var sState:String;
	
	private function initClip():Void {
		MiradorSite.getApp().addEventListener( MiradorSite.CONTEXT_CHANGED, Delegate.create( this, context_changed) );
		context_changed( { context: MiradorSite.getApp().getContext() } );
		this.onRelease = function() {
			MiradorSite.getApp().setSection( MiradorSite.HOME )
			return;
			if (MiradorSite.getApp().getContext() == MiradorSite.MIRADOR) MiradorSite.getApp().setContext( MiradorSite.DANBRO);
			else MiradorSite.getApp().setContext( MiradorSite.MIRADOR );
		}
	}
	
	private function context_changed( evnt ):Void {
		//trace("MiradorLogo context_changed= " + evnt.context );
		if ( evnt.context == MiradorSite.DANBRO ) {
			this.gotoAndPlay("DanbroAparece");
		} else {
			this.gotoAndPlay("MiradorAparece");
			//this.gotoAndPlay("DanbroDesaparece");
		}
		
	}
	
}